package com.lin.wx.pament.component;


import com.lin.wx.pament.component.model.Payment;
import com.lin.wx.pament.component.model.TransactionOrder;
import com.lin.wx.pament.component.model.TransactionResult;

/**
 * 统一支付服务
 *
 * @author: linjiang
 * @date: 2024/11/27
 */
public interface PaymentService<T extends Payment, C extends TransactionOrder> extends PaymentNotifyService<C> {

    /**
     * 下单支付
     *
     * @param payment
     * @return
     */
    TransactionResult prepay(T payment);

    /**
     * 查询订单
     *
     * @param queryOrder
     * @return
     */
    TransactionResult query(TransactionOrder queryOrder);

    /**
     * 取消订单
     *
     * @param closeOrder
     */
    void close(TransactionOrder closeOrder);

    /**
     * 订单退款
     *
     * @param payment
     * @return
     */
    TransactionResult refunds(T payment);

    /**
     * 支付产品（如：微信的jspai支付）
     *
     * @param support
     * @return
     */
    Boolean support(String support);

}
